Defines a generic, dynamically sizable list.
Gets the requested item from the list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(list), | intent(in) | :: | this |
The list object. |
||
| integer(kind=int32), | intent(in) | :: | i |
The one-based index of the item to retrieve. |
A pointer to the requested object.
Gets the capacity of the list.
The capacity is the available "space" in the collection for adding additional items without resizing the internal data store. This capacity includes the currently utilized space. To obtain a count of the actual number of items stored in the list use the count routine.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(list), | intent(in) | :: | this |
The list object. |
The capacity of the list.
Inserts an item into the list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(list), | intent(inout) | :: | this |
The list object. |
||
| integer(kind=int32) | :: | i |
The one-based index defining where to put the item. |
|||
| class(*), | intent(in) | :: | x |
The object to store. |
||
| logical, | intent(in), | optional | :: | manage |
An optional input used to determine if the list should manage memory for this object. If set to true a clone of x is stored and the list will handle management of resources held by the clone. If false, the list will not manage resources held by x and x itself will be stored. Notice, in this manner it is possible for x to go out of scope while the list still persists thereby resulting in a potentially undefined behavior. It is recommended to use the default value of true except for very specific and well controlled edge cases. |
Pushes an item onto the back of the list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(list), | intent(inout) | :: | this |
The list object. |
||
| class(*), | intent(in), | target | :: | x |
The object to store. |
|
| logical, | intent(in), | optional | :: | manage |
An optional input used to determine if the list should manage memory for this object. If set to true a clone of x is stored and the list will handle management of resources held by the clone. If false, the list will not manage resources held by x and x itself will be stored. Notice, in this manner it is possible for x to go out of scope while the list still persists thereby resulting in a potentially undefined behavior. It is recommended to use the default value of true except for very specific and well controlled edge cases. |
Sets the specified item into the list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(list), | intent(inout) | :: | this |
The list object. |
||
| integer(kind=int32), | intent(in) | :: | i |
The one-based index defining where to put the item. |
||
| class(*), | intent(in), | target | :: | x |
The object to store. |
|
| logical, | intent(in), | optional | :: | manage |
An optional input used to determine if the list should manage memory for this object. If set to true a clone of x is stored and the list will handle management of resources held by the clone. If false, the list will not manage resources held by x and x itself will be stored. Notice, in this manner it is possible for x to go out of scope while the list still persists thereby resulting in a potentially undefined behavior. It is recommended to use the default value of true except for very specific and well controlled edge cases. |
Sets the capacity of the list.
The capacity is the available "space" in the collection for adding additional items without resizing the internal data store. This capacity includes the currently utilized space. To obtain a count of the actual number of items stored in the list use the count routine.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(list), | intent(inout) | :: | this |
The list object. |
||
| integer(kind=int32), | intent(in) | :: | n |
The new capacity of the list. This value must be greater than or equal to 1. |